<template>
  <div class="code-header">
    <div class="code-header-content">
      <img @click="goBack" src="../../assets/img/leftArrow.png" width="25" />
      <p class="code-header-title">{{ title }}</p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: String
  },
  methods: {
    goBack() {
      history.go(-1);
    }
  }
};
</script>

<style lang="less" scoped>
.code-header {
  width: 100%;
  background: #fff;

  .code-header-content {
    position: relative;
    margin-left: 8px;
    padding: 5px 0;
    height: 26px;

    .code-header-title {
      position: absolute;
      top: 9px;
      left: 50%;
      font-size: 17px;
      font-weight: 600;
      color: #333;
      transform: translateX(-50%);
    }
  }
}
p {
  margin: 0;
  padding: 0;
}
</style>
